package com.hellobike.haxing.modules.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hellobike.haxing.modules.wms.dto.WarehouseShopDto;
import com.hellobike.haxing.modules.wms.entity.WarehouseShop;
import com.hellobike.haxing.modules.wms.mapper.WarehouseShopMapper;
import com.hellobike.haxing.modules.wms.service.IWarehouseShopService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: t_wms_warehouse_shop
 * @Author: haxing-boot
 * @Date:   2020-02-07
 * @Version: V1.0
 */
@Service
public class WarehouseShopServiceImpl extends ServiceImpl<WarehouseShopMapper, WarehouseShop> implements IWarehouseShopService {

    @Override
    public WarehouseShop getByShopId(Long shopId) {
        WarehouseShop param = new WarehouseShop();
        param.setShopId(shopId);
        Wrapper<WarehouseShop> wrapper = new QueryWrapper<>(param);
        return baseMapper.selectOne(wrapper);
    }

    @Override
    public IPage<WarehouseShopDto> pageByWarehouseShopDto(Page<WarehouseShopDto> page, WarehouseShopDto warehouseShop) {
        return baseMapper.pageByWarehouseShopDto(page,warehouseShop);
    }
}
